﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Messaging;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace CDistributed.Console
{
    class Program
    {
        static void Main(string[] args)
        {
            MessageQueue queues = MsmqContainer.GetInstance();
            queues.Purge();
            queues.Formatter = new XmlMessageFormatter(new Type[] { typeof(string) });

            for (int i = 0; i < 10000; i++)
            {
                Message message = new Message();
                message.Body = "内容" + i;
                message.Label = "标签" + i;
                queues.Send(message);

                System.Console.WriteLine(message.Body.ToString(), message.Label.ToString());

                Thread.Sleep(1000);
            }
        }
    }
}
